package model
{
	import model.vo.ConfigVO;
	import model.vo.LogoVO;
	
	import subumbo.micro.controller.Analytics;
	import subumbo.micro.model.IModel;
	
	public class ModelLocator implements IModel
	{
		/**
		 * VOs
		 */	
		public var logoVO:LogoVO;
		public var config:ConfigVO;
		
		
		/**
		 * VO Collections 
		 */		
		public var pages:Array = [];
		
		
		
		/**
		 * This method has to be implemented according to the IModel interface.
		 * 
		 * @param data is the event object that came with the ApplicationEvent.CONTROL that was, 
		 * dispatched by the UI component the user was interacting with.
		 * 
		 * Each UIComponent holds a refernce to its own model that get passed to the AppliactionEvent.CONTROL
		 * when dispatched.
		 * By making use of the "is" comparision the model can determine what UIComponent dispatched the event
		 * and update itself accordingly.
		 * 
		 * This VO will be passed to any UIComponent via the update method. For more info see Component class.
		 */		
		public function update(data:Object):void
		{
			if(data is LogoVO)
			{
				logoVO = LogoVO(data);
			}
			Analytics.instance.trackPage(data.toString());
		}
	}
}